// 终端编号 必须是number
export function deviceValidate (device) {
  let reg = /^\d+$/
  if (reg.test(device)) {
    return device
  } else {
    return ''
  }
}

// 功率的范围校验
export const validatePower = (rule, value, callback) => {
  let power = typeof value === 'string' ? parseFloat(value) : value
  if (power < -45 || power > -15) {
    callback(new Error())
  } else {
    callback()
  }
}
